<script>
	import config from './config'
	import store from '@/store'
	import {
		getToken
	} from '@/utils/auth'

	export default {
		onLaunch: function() {
			this.initApp()
		},
		methods: {
			// 初始化应用
			initApp() {
				// 初始化应用配置
				this.initConfig()
				// 检查用户登录状态
				//#ifdef H5
				this.checkLogin()
				//#endif
			},
			initConfig() {
				this.globalData.config = config
			},
			checkLogin() {
				console.log('app登录')
				if (!getToken()) {
					this.$tab.reLaunch('/subPages/commonPage/login')
				}
			}
		}
	}
</script>

<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	@import '@/uni_modules/uni-scss/index.scss';
	@import './static/scss/index.scss';
	html,
	body {
		overflow: hidden;
	}
	.column-center {
		display: flex;
		flex-flow: column nowrap;
		justify-content: center;
		align-items: center;
	}
	.row-between {
		display: flex;
		flex-flow: row nowrap;
		justify-content: space-between;
		align-items: center;
	}
	.row {
		display: flex;
		flex-flow: row wrap;
		align-items: center;
	}
	// 单行省略号
	.ellipsis-text {
	  white-space: nowrap; /* 不换行 */
	  overflow: hidden; /* 内容溢出时隐藏 */
	  text-overflow: ellipsis; /* 显示省略号 */
	}
	
	// 多行省略号
	.text-ellipsis-two {
	  display: -webkit-box;
	  -webkit-box-orient: vertical;
	  -webkit-line-clamp: 2;
	  overflow: hidden;
	  text-overflow: ellipsis;
	}
	
</style>